package com.hundsun.yr.universal.p2p.bean.enums;

import java.util.ArrayList;
import java.util.HashMap;

import com.hundsun.yr.universal.p2p.bean.UserPersonalInfo;
import com.hundsun.yr.universal.p2p.bean.enums.base.Enum;
import com.hundsun.yr.universal.p2p.bean.enums.base.LabelEnum;
/**
 * 工作年限枚举类
 * @author tonglj
 *
 */
public class WorkYearEnum extends LabelEnum{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	
	public static WorkYearEnum ONE_AND_UP = new WorkYearEnum("ONE_AND_UP", "1年以下");
	public static WorkYearEnum ONE_TO_THREE = new WorkYearEnum("ONE_TO_THREE", "1-3年");
	public static WorkYearEnum THREE_TO_FIVE = new WorkYearEnum("THREE_TO_FIVE", "3-5年");
	public static WorkYearEnum FIVE_AND_UP = new WorkYearEnum("FIVE_AND_UP", "5年以上");
	
	private static HashMap<String,String> mHashMap = new HashMap<String,String>();
	
	protected WorkYearEnum(String name, String lable) {
		super(name, lable, UserPersonalInfo.WORKYEAR);
		title = "工作年限";
	}
	
	@SuppressWarnings("unchecked")
	public static ArrayList<LabelEnum> getList() {
		mList.clear();
		mList.addAll(Enum.getEnumList(WorkYearEnum.class));
		return mList;
	}

	public static HashMap<String,String> getHashMap(){
		if(mHashMap==null || mHashMap.size()==0){ //保证mHashMap只进行一次赋值，只遍历一次mList
			ArrayList<LabelEnum> list = getList();
			for(LabelEnum labelEnum : list){
				mHashMap.put(labelEnum.getName(), labelEnum.getLable());
			}
		}
		return mHashMap;
	}


}
